package com.smart.workflow.repositories;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.smart.workflow.markers.ProcessRepository;

@Repository("processRepository")
public class ProcessRepositoryImpl implements ProcessRepository {
	
	Map<Integer, Object> processStore = new HashMap<Integer, Object>();

	@Override
	public Integer saveProcess(Object process) {
		processStore.put(processStore.size(), process);
		return processStore.size()-1;
	}

	@Override
	public Object getProcessById(Integer id) {
		return processStore.get(id);
	}
	
	public Collection<Object> getAllProcesses() {
		return processStore.values();
	}

}
